from django import newforms as forms

class PostBodyForm(forms.Form):
    body = forms.CharField(widget=forms.Textarea)
    
    def clean_body(self):
        self.cleaned_data['body'] = self.cleaned_data['body'].strip()
        if len(self.cleaned_data['body']) == 0:
            raise forms.ValidationError(u'This field is required.')
        return self.cleaned_data['body']